﻿<!DOCTYPE HTML>
<html>
<head th:include="fragments/_header :: _head('历史选项')"></head>
<body>
<div class="page-container">
	<div class="dataTables_wrapper no-footer  mt-20">
		<table class="table table-border table-bordered table-bg">
			<thead>
				<tr>
					<th scope="col" colspan="5">选项列表</th>
				</tr>
				<tr class="text-c">
					<th width="90">期号</th>
					<th width="100">选项</th>
					<th width="100">计算赔率</th>
					<th width="100">设置赔率</th>
				</tr>
			</thead>
			<tbody>
				<tr class="text-c"  th:each="project:${list}">
					<td th:text="${project.expect}">13000000000</td>
					<td th:if="${project.projectItemCode==0}">没牛</td>
					<td th:if="${project.projectItemCode==1}">牛一</td>
					<td th:if="${project.projectItemCode==2}">牛二</td>
					<td th:if="${project.projectItemCode==3}">牛三</td>
					<td th:if="${project.projectItemCode==4}">牛四</td>
					<td th:if="${project.projectItemCode==5}">牛五</td>
					<td th:if="${project.projectItemCode==6}">牛六</td>
					<td th:if="${project.projectItemCode==7}">牛七</td>
					<td th:if="${project.projectItemCode==8}">牛八</td>
					<td th:if="${project.projectItemCode==9}">牛九</td>
					<td th:if="${project.projectItemCode==10}">牛牛</td>
					<td th:text="${project.percent}">project@mail.com</td>
					<td><input class="odds" th:readonly="${close}" name="handPercent" th:value="${project.handPercent}"  th:cid="${project.expect}" th:aid="${project.projectId}" th:bid="${project.projectItemCode}" ></td>
				</tr>
			</tbody>
		</table>
	</div>
</div>
<div th:include="fragments/_footer :: _footer"></div>
<script type="text/javascript" src="/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript">
	/*用户-编辑*/
	function modify(title,url,obj,w,h){
		var id = $(obj).attr("aid");
		var pid = $("#projectId").val();
		layer_show(title, url + "?id=" + id+"&projectId="+pid, w, h);
	}
	$(function(){
		$(".odds").blur(function(){
			var projectId=$(this).attr("aid");
			var code=$(this).attr("bid");
			var expect=$(this).attr("cid");
			var odds=$(this).val();
			$.post("/project/history/item/odds", {projectId:projectId,expect:expect,code:code,percent:odds},
					function(result){
						if (result.success) {
							layer.msg("修改成功", {icon: 1, time: 1000});
						} else {
							layer.msg(result.msg, {icon: 2, time: 1000});
							parent.window.location.reload();
						}
					});
		});
	});
</script>
</body>
</html>